#include <bits/stdc++.h>
#define mod 998244353
#define File(xxx) freopen(xxx".in","r",stdin),freopen(xxx".out","w",stdout)
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
const int N = 2e7+5;
int n, m, a[2][N], ans;

template <typename T> void debug(T x) { cerr<<x; }
template <typename T, typename ..._T> void debug(T x, _T...p) { cerr<<x<<' '; debug(p...); }
template <typename T> void read(T& x) {
    x=0; int f=0; char c=getchar();
    while(c < '0' || c > '9') f|=(c == '-'), c=getchar();
    while(c >= '0' && c <= '9') x=(x<<1)+(x<<3)+(c^48), c=getchar();
    x=(f ? -x : x);
}
int lne; char put[105];
template <typename T> void write(T x, char c) {
    lne=0; if(x < 0) putchar('-'), x=-x;
    do { put[++lne]=x%10, x/=10; } while (x);
    while(lne) putchar(put[lne]^48), --lne;
    putchar(c);
}
int upd(int x) {
    return (x >= mod ? x-mod : x);
}

signed main() {
    File("drama");
    read(n), read(m);
    a[0][0]=1;
    int now = 0;
    for(int i = 1; i <= n; ++i) {
        int sum = 0;
        now^=1;
        for(int j = 0; j <= m; ++j)
            a[now][j]=sum, sum=1LL*sum*i%mod, sum=upd(sum+a[now^1][j]);
        ans=upd(ans+a[now][m]);
    }
    write(ans, '\n');
    return 0;
}